package main

import (
	"fmt"
)

type Camera struct{}

func (c *Camera) TakeAPicture() string {
	return "Click"
}
func (c *Camera) name() {
	fmt.Println("相机")
}

type Phone struct{}

func (p *Phone) Call() string {
	return "Ring Ring"
}
func (p *Phone) name() {
	fmt.Println("电话")
}
type CameraPhone struct {
	Camera
	Phone
}

func main() {
	cp := new(CameraPhone)
	fmt.Println("开始工作...")
	fmt.Println("照个相: ", cp.TakeAPicture())
	fmt.Println("打个电话: ", cp.Call())

	//冲突的方法
	//cp.name()
	cp.Phone.name()
}